import logging
from redis import StrictRedis


class Config(object):

    SECRET_KEY = "AHKANKGENJK"
    SQLALCHEMY_DATABASE_URI = "mysql://root:djbaka@127.0.0.1:3306/infomation04"
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379
    SESSION_TYPE = "redis"
    ##是否开启session签名
    SESSION_USE_SIGNER = True
    SESSION_PERMANNET = False
    PERMANNET_SESSION_LIFETIME = 86000
    SESSION_REDIS = StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
    LOGGING_LEVEL = logging.DEBUG


class Development(Config):
    """开发环境"""
    DEBUG = True


class Production(Config):
    DEBUG=False
    LOGGING_LEVEL = logging.WARNING

class TestingConfig(Config):
    DEBUG=True
    TESTING = True

config = {
    "development":Development,
    "production":Production,
    "testing":TestingConfig
}